﻿


  
using System;
using SubSonic;
using SubSonic.Schema;
using SubSonic.DataProviders;
using System.Data;

namespace SurveyTracker.Data{
	public partial class surveyTrackerDB{

        public StoredProcedure addBlockedEmail(string email_hash_key){
            StoredProcedure sp=new StoredProcedure("addBlockedEmail",this.Provider);
            sp.Command.AddParameter("email_hash_key",email_hash_key,DbType.AnsiString);
            return sp;
        }
        public StoredProcedure addMailingDetails(string MailingName,DateTime MailingDate,string MailingSubject,string MailingAuthor,string MailingFromEmail,string MailingReplyToEmail,string MailingText,string MailingSurveyLink){
            StoredProcedure sp=new StoredProcedure("addMailingDetails",this.Provider);
            sp.Command.AddParameter("MailingName",MailingName,DbType.AnsiString);
            sp.Command.AddParameter("MailingDate",MailingDate,DbType.DateTime);
            sp.Command.AddParameter("MailingSubject",MailingSubject,DbType.AnsiString);
            sp.Command.AddParameter("MailingAuthor",MailingAuthor,DbType.AnsiString);
            sp.Command.AddParameter("MailingFromEmail",MailingFromEmail,DbType.AnsiString);
            sp.Command.AddParameter("MailingReplyToEmail",MailingReplyToEmail,DbType.AnsiString);
            sp.Command.AddParameter("MailingText",MailingText,DbType.String);
            sp.Command.AddParameter("MailingSurveyLink",MailingSurveyLink,DbType.AnsiString);
            return sp;
        }
        public StoredProcedure addMailingHistoryDetails(int MailingId,int ListId,DateTime MailingDate,int EmailId,string Status,string emailHashKey){
            StoredProcedure sp=new StoredProcedure("addMailingHistoryDetails",this.Provider);
            sp.Command.AddParameter("MailingId",MailingId,DbType.Int32);
            sp.Command.AddParameter("ListId",ListId,DbType.Int32);
            sp.Command.AddParameter("MailingDate",MailingDate,DbType.DateTime);
            sp.Command.AddParameter("EmailId",EmailId,DbType.Int32);
            sp.Command.AddParameter("Status",Status,DbType.AnsiString);
            sp.Command.AddParameter("emailHashKey",emailHashKey,DbType.AnsiString);
            return sp;
        }
        public StoredProcedure GetEmailLists(){
            StoredProcedure sp=new StoredProcedure("GetEmailLists",this.Provider);
            return sp;
        }
        public StoredProcedure getEmailsFromList(int list){
            StoredProcedure sp=new StoredProcedure("getEmailsFromList",this.Provider);
            sp.Command.AddParameter("list",list,DbType.Int32);
            return sp;
        }
        public StoredProcedure getMailingHistory(){
            StoredProcedure sp=new StoredProcedure("getMailingHistory",this.Provider);
            return sp;
        }
        public StoredProcedure getUserSurveyLink(string email_hash_key){
            StoredProcedure sp=new StoredProcedure("getUserSurveyLink",this.Provider);
            sp.Command.AddParameter("email_hash_key",email_hash_key,DbType.AnsiString);
            return sp;
        }
        public StoredProcedure getValidEmailsByList(int listID){
            StoredProcedure sp=new StoredProcedure("getValidEmailsByList",this.Provider);
            sp.Command.AddParameter("listID",listID,DbType.Int32);
            return sp;
        }
        public StoredProcedure isEmailAddedToList(string email,int list){
            StoredProcedure sp=new StoredProcedure("isEmailAddedToList",this.Provider);
            sp.Command.AddParameter("email",email,DbType.AnsiString);
            sp.Command.AddParameter("list",list,DbType.Int32);
            return sp;
        }
        public StoredProcedure updateUserSurveyLinkStatus(string email_hash_key,string status){
            StoredProcedure sp=new StoredProcedure("updateUserSurveyLinkStatus",this.Provider);
            sp.Command.AddParameter("email_hash_key",email_hash_key,DbType.AnsiString);
            sp.Command.AddParameter("status",status,DbType.AnsiString);
            return sp;
        }
	
	}
	
}
 